<template>
  <el-dialog
    :title="`算子详情 - ${formData.name}`"
    :visible.sync="visible"
    width="50%"
    @close="handleClose"
  >
    <el-descriptions title="算子信息" :column="1" border>
      <el-descriptions-item label="算子名称">{{ formData.name }}</el-descriptions-item>
      <el-descriptions-item label="算子类型">{{ formData.type }}</el-descriptions-item>
      <el-descriptions-item label="处理方式">{{ formData.processingMethod }}</el-descriptions-item>
      <el-descriptions-item label="描述">
        <div style="white-space: pre-line">{{ formData.description }}</div>
      </el-descriptions-item>
      <el-descriptions-item label="内容">
        <div style="white-space: pre-line">{{ formData.content }}</div>
      </el-descriptions-item>
    </el-descriptions>
    <span slot="footer" class="dialog-footer">
      <el-button type="primary" @click="handleClose">关闭</el-button>
    </span>
  </el-dialog>
</template>

<script>
export default {
  name: "OperatorDetail",
  props: {
    visible: {
      type: Boolean,
      required: true
    },
    formData: {
      type: Object,
      required: true
    },
  },
  methods: {
    handleClose() {
      this.$emit('update:visible', false);
    }
  }
};
</script>

<style scoped>
/* 如果需要自定义样式，可以在这里添加 */
</style>
